<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('订单详情')" />
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox-content p-xl">
                <div class="row">
                    <div class="col-sm-6 text-left">
                        <h4>单据编号：</h4>
                        <h4 class="text-navy" th:text="${order.orderNum}"></h4>
                        <h4>支付状态：<i th:if="${order.payStatus == 0}" style="color: red">未支付</i><i th:if="${order.payStatus == 1}" style="color: #00B83F">已支付</i></h4>
                        <p>
                            <span><strong>下单日期：</strong> <strong th:text="${#dates.format(order.genDate, 'yyyy-MM-dd')}">2014-11-11</strong></span>
                        </p>
                    </div>
                </div>

                <div class="table-responsive m-t">
                    <table class="table invoice-table">
                        <thead>
                        <tr>
                            <th>商品名称</th>
                            <th>数量</th>
                            <th>单价</th>
                            <th>总价</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr th:each="info:${details}">
                            <td>
                                <div><strong th:text="${info.cosmetics.name}"></strong>
                                </div>
                            </td>
                            <td>
                                <div>
                                    <strong th:text="${info.number}"></strong>
                                    <strong th:text="${info.cosmetics.unit}"></strong>
                                </div>
                            </td>
                            <td>
                                <div>
                                    <strong>￥ </strong>
                                    <strong th:text="${info.cosmetics.price}"></strong>
                                </div>
                            </td>
                            <td >
                                <div>
                                    <strong>￥ </strong>
                                    <strong th:text="${info.price}"></strong>
                                </div>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
                <!-- /table-responsive -->

                <table class="table invoice-total">
                    <tbody>
                    <tr>
                        <td><strong>订单总价：</strong>
                        </td>
                        <td>
                            <strong>￥ </strong>
                            <strong th:text="${order.price}"></strong>
                        </td>
                    </tr>
<!--                    <tr>-->
<!--                        <td><strong>税：</strong>-->
<!--                        </td>-->
<!--                        <td>&yen;235.98</td>-->
<!--                    </tr>-->
<!--                    <tr>-->
<!--                        <td><strong>总计</strong>-->
<!--                        </td>-->
<!--                        <td>&yen;1261.98</td>-->
<!--                    </tr>-->
                    </tbody>
                </table>
                <!-- 打印网页时通过hidden-print隐藏元素 -->
                <div class="text-right hidden-print">
<!--                    <button th:if="${order.payStatus == 0}" class="btn btn-info" onclick="pay()"><i class="fa fa-shopping-bag"></i> 支付</button>-->
                    <button class="btn btn-primary" onclick="printPage()"><i class="fa fa-print"></i> 打印</button>
                    <button class="btn btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i> 关闭</button>
                </div>

<!--                <div class="well m-t"><strong>注意：</strong> 请在30日内完成付款，否则订单会自动取消。-->
<!--                </div>-->
            </div>
        </div>
    </div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
    var myOrder = [[${order}]]

    function printPage() {
        window.print();
    }

    //订单支付
    function pay() {
        $.modal.confirm("确认要支付费用吗？", function() {
            $.operate.post(ctx + "admin/order/payOrder", { "orderId": myOrder.orderId});
            $.modal.reload();
        })
    }
</script>
</body>
</html>
